-
-
Notifications
You must be signed in to change notification settings - Fork 378
Double pinyin query #2427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Double pinyin query #2427
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
{"ian", "m"} | ||
}); | ||
|
||
private static string ToDoublePin(string fullPinyin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be better to use ReadOnlySpan
as we have quite a few slicing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
73c4a69
to
22f6ad7
Compare
@VictoriousRaptor what's the status of this pr? |
POC. I'm using it daily and so far so good. Since there're many double pinyin mappings we should make it user configurable. Is it acceptable to allow users to edit a json file that defines the mapping? |
well I can't think anything better...maybe I do want this to be plugin-able, but can't think of a good way to design the api. |
0c01c95
to
f673000
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for a double pinyin query by introducing a new double_pinyin.json resource and integrating this functionality into the settings and pinyin translation mechanisms.
- Adds a new JSON resource for double pinyin mappings.
- Updates the project file to include the new resource.
- Extends Settings, TranslationMapping, StringMatcher, and PinyinAlphabet to support double pinyin translation.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
Flow.Launcher/Resources/double_pinyin.json | New resource file containing pinyin mappings. |
Flow.Launcher/Flow.Launcher.csproj | Updated to copy the double_pinyin.json resource to output. |
Flow.Launcher.Infrastructure/UserSettings/Settings.cs | Added new settings (UseDoublePinyin and DoublePinyinSchema). |
Flow.Launcher.Infrastructure/TranslationMapping.cs | No functional changes; existing mapping logic is maintained. |
Flow.Launcher.Infrastructure/StringMatcher.cs | Adjustments to pinyin translation checks and method modifiers. |
Flow.Launcher.Infrastructure/PinyinAlphabet.cs | Major modifications to load double pinyin data and update pinyin translation logic. |
Flow.Launcher.Infrastructure/IAlphabet.cs | Minor interface update reflecting translation API changes. |
|
||
bool pre = false; | ||
var previousIsChinese = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within the BuildCacheFromContent loop, the flag 'previousIsChinese' is never updated after processing a Chinese character, which prevents the intended spacing logic from triggering. Consider setting 'previousIsChinese = true' after appending a Chinese pinyin translation (and resetting it appropriately in the non-Chinese branch).
Copilot uses AI. Check for mistakes.
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
No description provided.